---
image: /generated/articles-docs-webcodecs-get-default-audio-codec.png
id: get-default-audio-codec
title: getDefaultAudioCodec()
slug: /webcodecs/get-default-audio-codec
crumb: '@remotion/webcodecs'
---

:::warning
[We are phasing out Remotion WebCodecs and are moving to Mediabunny](/blog/mediabunny)!
:::

_Part of the [`@remotion/webcodecs`](/docs/webcodecs) package._

:::warning
**Unstable API**: This package is experimental. We might change the API at any time, until we remove this notice.
:::

Gets the default audio codec for a container that `@remotion/webcodecs` uses if no other audio codec was specified.

```tsx twoslash title="Get the default audio codec for a container"
import {getDefaultAudioCodec} from '@remotion/webcodecs';

getDefaultAudioCodec({container: 'webm'}); // 'opus'
```

Currently, the only supported container is `webm`, for which the default audio codec is `opus`.

## Default audio codecs

import {DefaultAudioCodecs} from './DefaultAudioCodecs';

<DefaultAudioCodecs />

## See also

- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/webcodecs/src/get-default-audio-codec.ts)
- [`getDefaultVideoCodec()`](/docs/webcodecs/get-default-video-codec)
